import React, {useEffect, useState} from 'react'
import { Space, Table, Button, theme } from 'antd';
import { AddCon } from './components/AddCon' 
import {
  ProForm,
  ProFormUploadButton,
  ProFormUploadDragger,
} from '@ant-design/pro-components';

const CreateQuestion = () => {
  const [btnStatus, setBtnStatus] = useState(true)


  return (
    <div>
      <h1>添加试题</h1>
      <Space>
        <Button key='btn-1' type={btnStatus ? "primary" : "default"} onClick={() => setBtnStatus(!btnStatus)}>手动添加</Button>
        <Button key='btn-2' type={btnStatus ? "default" : "primary"} onClick={() => setBtnStatus(!btnStatus)}>批量导入</Button>
      </Space>
      {btnStatus ? 
      <AddCon/>
        :
      <ProForm>
        <ProFormUploadDragger max={4} label="Dragger" name="dragger" />
      </ProForm>}
    </div>
  )
}

export default CreateQuestion